using System;
using NHibernate;
using Tools.Common.UnitOfWork.Contracts;

namespace Web.App.Infrastructure.UnitOfWork.Implementations
{
    [Serializable]
    public class NHibernateUoWTransaction : IUoWTransaction
    {
        private ITransaction transaction;

        public NHibernateUoWTransaction(ITransaction transaction)
        {
            this.transaction = transaction;
        }

        public void Commit()
        {
            transaction.Commit();
        }

        public void Rollback()
        {
            transaction.Rollback();
        }

        public void Dispose()
        {
            transaction.Dispose();
        }
    }
}